Skip to content

Serve Markdown alternates for pages and news posts - #3997

Merged
hsbt merged 2 commits into
masterfrom
claude/zen-mclaren-a95bef
Aug 5, 2026
Merged

Serve Markdown alternates for pages and news posts#3997
hsbt merged 2 commits into
masterfrom
claude/zen-mclaren-a95bef

Conversation

@hsbt

@hsbt hsbt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Every Markdown page and news post now gets a .md route next to its HTML page, so /en/about/ can also be fetched as /en/about.md. The copy is the source with front matter stripped and Liquid rendered, so pages like /en/downloads.md keep their expanded release version numbers. The HTML head advertises the route via <link rel="alternate" type="text/markdown">. This implements the .md routes item from the LLM discoverability scorecard at https://ruby.evilmartians.com/ and adapts _plugins/markdown_alternates.rb from rubygems/guides#524. Pages whose URL does not end with / (such as 404.md) and pages not written in Markdown are skipped, and generated news archive pages get no alternate. GitHub Pages serves the files as text/markdown; charset=utf-8.

Every page and news post written in Markdown now gets a .md route next
to its HTML page, with front matter stripped and Liquid rendered, and
the HTML head advertises it via link rel=alternate. This makes the
content directly consumable by LLM tools.
@hsbt
hsbt requested a review from a team as a code owner August 5, 2026 22:14
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploying www-ruby-lang-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: 060e4b4
Status: ✅  Deploy successful!
Preview URL: https://4c397898.www-ruby-lang-org.pages.dev
Branch Preview URL: https://claude-zen-mclaren-a95bef.www-ruby-lang-org.pages.dev

View logs

The Cloudflare build environment has no locale set, so the default
external encoding is US-ASCII and reading non-ASCII sources broke the
front matter match. Read with bom|utf-8 as Jekyll itself does.
@hsbt
hsbt merged commit ee6aa98 into master Aug 5, 2026
3 checks passed
@hsbt
hsbt deleted the claude/zen-mclaren-a95bef branch August 5, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant